<template>
	<view>
		<view class="" v-if="!billList.length"><u-empty text="暂无邀请记录" textSize="30rpx" marginTop="335rpx" width="330rpx"
				height="256rpx" icon="order"></u-empty></view>
		<view v-if="billList.length">
			<view class="box-top-x">
				<text>用户ID</text>
				<text>消费金额</text>
				<text>类型</text>
				<text>佣金</text>
			</view>
			<view class="bill" v-for="(item, index) in billList" :key="billListIndex">
				<view class="bill_time">
					{{ item.time }}
				</view>
				<view class="bill_content">
					<text>{{ item.sourceid?item.sourceid:'客服'}}</text>
					<text>{{ item.fee }}</text>
					<text>{{ item.type == 1?'返佣':'提现' }}</text>
					<text>{{ item.cash }}</text>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		apiMixUrlKeyApi
	} from "../../api/assemb";

	export default {
		data() {
			return {
				billList: []
			};
		},
		onLoad() {
			this.loadpeople();
		},
		methods: {
			loadpeople() {
				var self = this
				var baseinfo = uni.getStorageSync("baseinfo");
				let timestamp = Date.parse(new Date()) / 1000;
				baseinfo.timestamp = timestamp;
				var prams = {
					base: baseinfo,
					type:'1'
				};
				apiMixUrlKeyApi(prams, '1055', 'GetAwardRecord').then(res => {
					console.log('res', res)
					this.billList = res.data.history
				})
			},
		}
	};
</script>

<style lang="scss" scoped>
	.box-top-x {
		display: flex;
		width: 750rpx;
		height: 72rpx;
		color: #000;
		background: #F5F5F5;
		justify-content: space-evenly;
		align-items: center;
		margin-bottom: 30rpx;
	}

	.bill {
		width: 100%;
		margin-left: 30rpx;
	}

	.bill_time {
		margin: 20rpx 0;
	}

	.bill_content {
		position: relative;
		width: 700rpx;
		height: 97rpx;
		background: #F7F7F7;
		line-height: 97rpx;

		text:nth-child(1) {
			margin: 0 30rpx 0 6%;
		}

		text:nth-child(2) {
			margin: 0 0 0 20rpx;

		}

		text:nth-child(3) {
			position: absolute;
			right: 215rpx;
		}

		text:nth-child(4) {
			position: absolute;
			right: 10%;
		}
	}
</style>